package com.blueberry.common.core.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

public final class StringUtil extends StringUtils {

    public static final String DOT = ".";


    public static String simpleClassName(Class<?> clazz) {
        if (Objects.isNull(clazz)) {
            throw new NullPointerException();
        }
        String className = clazz.getName();
        int lastIndexOf = className.lastIndexOf(DOT);
        if (lastIndexOf > -1) {
            return className.substring(lastIndexOf + 1);
        }

        return className;
    }
}
